package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Stu_Fam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * @author lai
 * @data 2021/11/19
 * @apiNote
 */

public interface Stu_FamMapper extends BaseMapper<Stu_Fam> {

    @Insert("INSERT INTO sys_student_family VALUES(#{stuId},#{famId})")
    void insert(Integer stuId, Integer famId);

    @Delete("DELETE FROM sys_student_family WHERE student_id=#{stuId} AND family_id=#{famId}")
    void delete1(Integer stuId, Integer famId);

    @Select("SELECT * FROM `sys_student_family` WHERE family_id=#{familyId}")
    Stu_Fam selectByFamilyId(Integer familyId);
}
